cmake_minimum_required(VERSION 3.12)
project(fishbot_costmap_filter)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(tl_expected REQUIRED)
find_package(generate_parameter_library REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(nav2_costmap_2d REQUIRED)
find_package(nav2_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(pluginlib REQUIRED)




set(
  THIS_PACKAGE_INCLUDE_DEPENDS
  rclcpp
  tl_expected
  generate_parameter_library
  rclcpp_action
  rclcpp_components
  nav2_costmap_2d
  nav2_msgs
  std_msgs
  pluginlib
)

add_library(fishbot_costmap_filter SHARED src/gray_filter.cpp)
target_include_directories(fishbot_costmap_filter PUBLIC
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  $<INSTALL_INTERFACE:include>
)

ament_target_dependencies(fishbot_costmap_filter PUBLIC  ${THIS_PACKAGE_INCLUDE_DEPENDS} )

# Install libraries

install(
  DIRECTORY include/
  DESTINATION include
)

install(
  DIRECTORY launch param maps
  DESTINATION share/${PROJECT_NAME}
)
install(TARGETS fishbot_costmap_filter
        DESTINATION lib)


if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  # the following line skips the linter which checks for copyrights
  set(ament_cmake_copyright_FOUND TRUE)
  set(ament_cmake_cpplint_FOUND TRUE)
  ament_lint_auto_find_test_dependencies()

  find_package(ament_cmake_gtest REQUIRED)

  add_subdirectory(test)
endif()




ament_export_include_directories(
  include
)
ament_export_libraries(
  ${PROJECT_NAME}
)
# ament_export_targets(
#   export_${PROJECT_NAME}
# )
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
pluginlib_export_plugin_description_file(nav2_costmap_2d plugin.xml)
ament_package()